[project]
name = "llm-guard"
description = "LLM-Guard is a comprehensive tool designed to fortify the security of Large Language Models (LLMs). By offering sanitization, detection of harmful language, prevention of data leakage, and resistance against prompt injection attacks, LLM-Guard ensures that your interactions with LLMs remain safe and secure."
authors = [
  { name = "Protect AI", email = "community@protectai.com"}
]
keywords = ["llm", "language model", "security", "adversarial attacks", "prompt injection", "prompt leakage", "PII detection", "self-hardening", "firewall"]
license = { file = "LICENSE" }
readme = "README.md"
dynamic = ["version"]
classifiers = [
  "Development Status :: 4 - Beta",
  "Intended Audience :: Developers",
  "License :: OSI Approved :: MIT License",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
]
requires-python = ">=3.9"

dependencies = [
  "detect-secrets==1.4.0",
  "faker>=22,<24",
  "fuzzysearch==0.7.3",
  "json-repair==0.8.1",
  "nltk>=3.8,<4",
  "presidio-analyzer>=2.2,<3",
  "presidio-anonymizer>=2.2,<3",
  "protobuf>=4",
  "regex==2023.12.25",
  "sentencepiece==0.1.99",
  "tiktoken>=0.5,<0.7",
  "torch==2.0.1",
  "transformers==4.36.2",
  "xformers==0.0.22",
  "span-marker==1.5.0",
  "structlog>=24"
]

[project.optional-dependencies]
onnxruntime = [
  "optimum[onnxruntime]",
]
onnxruntime-gpu = [
  "optimum[onnxruntime-gpu]",
]
docs-dev = [
  "mkdocs>=1.5,<2",
  "mkdocs-autorefs==0.5.0",
  "mkdocs-git-revision-date-localized-plugin>=1.2",
  "mkdocs-jupyter>=0.24",
  "mkdocs-material>=9.5",
  "mkdocs-material-extensions>=1.3",
  "mkdocs-swagger-ui-tag>=0.6",
]
dev = [
  "llm_guard[docs-dev]",
  "autoflake>=2,<3",
  "black>=23,<25",
  "isort>5,<6",
  "pytest>=7.4,<9",
  "pytest-cov>=4.1,<5",
  "pre-commit>=3.6,<4",
]

[project.urls]
homepage = "https://github.com/protectai/llm-guard"
documentation = "https://llm-guard.com/"
repository = "https://github.com/protectai/llm-guard"
issues = "https://github.com/protectai/llm-guard/issues"
changelog = "https://llm-guard.com/changelog/"

[tool.setuptools]
packages = {find = {where=["."], include=["llm_guard", "llm_guard.*"]}}
license-files = [
  "LICENSE"
]

[tool.setuptools.dynamic]
version = {attr = "llm_guard.version.__version__"}

[tool.setuptools.package-data]
llm_guard = [
  "**/*.json"
]

[tool.pytest.ini_options]
addopts = "-p no:warnings"
log-level = "DEBUG"

# The flag below should only be activated in special debug sessions
# i.e. the test hangs and we need to see what happened up to that point.
# There are some race conditions with how the logging streams are closed in the teardown
# phase, which will cause tests to fail or "magically" ignored.
log_cli = "False"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
